package org.example.logindemo.runner;

import org.example.logindemo.utils.RedisCache;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class InitRunner implements CommandLineRunner {

    @Resource
    private RedisCache redisCache;

    public InitRunner(RedisCache redisCache){
        this.redisCache = redisCache;
    }

    @Override
    public void run(String... args) throws Exception {
        redisCache.clearAll();// 清空redis中的所有信息
    }
}
